package com.tarena.lbs.coupon.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 将本地文件路径映射为HTTP URL
        registry.addResourceHandler("/files/**")
                .addResourceLocations("file:E:/files/");
    }
}